package cn.tju.yanbo.utils;

import java.util.HashMap;
import java.util.Map;

import android.graphics.Point;

import cn.tju.yanbo.R;

public class AppConfig {
    public static final int SETTING_CHOICE_RADIO_TOTAL = 3;
    public static final int TOTAL_YIJI_IMAGE_VIEW_COUNT = 5;
    public static final int MAX_YI_JI_CHOICES = 4;
    public static final int MENU_COUNT = 6;
    public static final long ANIMATION_DURATION = 500;
    public static final long ANIMATION_ZERO_DURATION = 0;
    public static final String YIJI_IMAGE_VIEW_TAG = "yiji_image_view";
    public static final Point DATE_COMPASS_CENTROID = new Point(AppUtils.SCREEN_METRICS.widthPixels/2, 254);
    public static final int [] DATE_RING_SERIES_RADIUS = new int[]{38, 76, 114, 151};
    public static final int [] DATE_COMPASS_SERIES_IDS = new int[]{R.id.date_compass_year, R.id.date_compass_month, R.id.date_compass_day, R.id.date_compass_lunarhour};
    private static Map<String, String> APP_CONFIG = new HashMap<String, String>();
    public static int [][] DATE_VIEW_ID = new int[][]{
        {R.id.date_year},
        {R.id.date_left_month_2, R.id.date_left_month_1, R.id.date_month, R.id.date_right_month_1, R.id.date_right_month_2},
        {R.id.date_left_day_3, R.id.date_left_day_2, R.id.date_left_day_1, R.id.date_day, R.id.date_right_day_1, R.id.date_right_day_2, R.id.date_right_day_3},
        {R.id.date_left_hour_4, R.id.date_left_hour_3, R.id.date_left_hour_2, R.id.date_left_hour_1, R.id.date_hour, R.id.date_right_hour_1, R.id.date_right_hour_2, R.id.date_right_hour_3, R.id.date_right_hour_4}
    };
    public static String [] YIJI_PIC_NAMES = new String[]{
        "anchuang","anmen","anzang","chuxing","dingmeng","dongtu","furen",
        "guabian","guanji","huaiyuan","jiaqu","jiechu","jisi",
        "kaichi","kaiguang","kaishi","lijuan","nacai","naqian",
        "potu","qiucai","qifu","qiusi","rulian","shangliang",
        "xiuzao","yanyin","yixi","zaizhong","zhaizhan"
    };
    public static final int YIJI_PIC_TOTAL = YIJI_PIC_NAMES.length;
    
    static {
        APP_CONFIG.put("shanghai", "上海");
        APP_CONFIG.put("changsha", "长沙");
        APP_CONFIG.put("beijing", "北京");
        
        APP_CONFIG.put("mostly_cloudy", String.valueOf(R.drawable.cloudy));
        APP_CONFIG.put("light_rain", String.valueOf(R.drawable.light_rain));
        APP_CONFIG.put("clear", String.valueOf(R.drawable.clear));
        APP_CONFIG.put("cloudy", String.valueOf(R.drawable.cloudy));
        APP_CONFIG.put("partly_cloudy", String.valueOf(R.drawable.partly_cloudy));
        APP_CONFIG.put("rain", String.valueOf(R.drawable.rain));
        
        APP_CONFIG.put("compass_year_ring", "15");
        APP_CONFIG.put("compass_month_ring", "57");
        APP_CONFIG.put("compass_day_ring", "95");
        APP_CONFIG.put("compass_occasion_ring", "132");
        APP_CONFIG.put("compass_hour_ring", "132");
        APP_CONFIG.put("lunar_date_year_ring", "20");
        APP_CONFIG.put("lunar_date_month_ring", "71");
        APP_CONFIG.put("lunar_date_day_ring", "124");
        
        APP_CONFIG.put("lunar_year_mid", "180");
        APP_CONFIG.put("year_mid", "0");
        APP_CONFIG.put("lunar_month_mid", "180");
        APP_CONFIG.put("month_mid", "0");
        APP_CONFIG.put("month_left_1", "-36");
        APP_CONFIG.put("month_left_2", "-72");
        APP_CONFIG.put("month_left_3", "-90");
        APP_CONFIG.put("month_right_1", "36");
        APP_CONFIG.put("month_right_2", "72");
        APP_CONFIG.put("month_right_3", "90");
        APP_CONFIG.put("day_mid", "0");
        APP_CONFIG.put("lunar_day_mid", "180");
        APP_CONFIG.put("day_right_1", "25.7");
        APP_CONFIG.put("day_right_2", "51.4");
        APP_CONFIG.put("day_right_3", "77.1");
        APP_CONFIG.put("day_right_4", "90");
        APP_CONFIG.put("day_left_1", "-25.7");
        APP_CONFIG.put("day_left_2", "-51.4");
        APP_CONFIG.put("day_left_3", "-77.1");
        APP_CONFIG.put("day_left_4", "-90");
        
        APP_CONFIG.put("hour_left_4", "-80");
        APP_CONFIG.put("hour_left_3", "-60");
        APP_CONFIG.put("hour_left_2", "-40");
        APP_CONFIG.put("hour_left_1", "-20");
        APP_CONFIG.put("hour_mid", "0");
        APP_CONFIG.put("hour_right_1", "20");
        APP_CONFIG.put("hour_right_2", "40");
        APP_CONFIG.put("hour_right_3", "60");
        APP_CONFIG.put("hour_right_4", "80");
        
       APP_CONFIG.put("子时","冲马-煞南");
       APP_CONFIG.put("丑时","冲羊-煞东");
       APP_CONFIG.put("寅时","冲猴-煞北");
       APP_CONFIG.put("卯时","冲鸡-煞西");
       APP_CONFIG.put("辰时","冲狗-煞南");
       APP_CONFIG.put("巳时","冲猪-煞东");
       APP_CONFIG.put("午时","冲鼠-煞东");
       APP_CONFIG.put("申时","冲牛-煞西");
       APP_CONFIG.put("未时","冲虎-煞南");
       APP_CONFIG.put("酉时","冲兔-煞东");
       APP_CONFIG.put("戌时","冲龙-煞北");
       APP_CONFIG.put("亥时","冲蛇-煞西");
    }
    
    public static String get(String key) {
        return APP_CONFIG.get(key);
    }
    
    public static void put(String key, String value) {
        APP_CONFIG.put(key, value);
    }
    
    public static boolean initDatabase() {
        return true;
    }
}
